package ptij.verifier.test.grammar;

import ptolemy.actor.*;
import ptolemy.kernel.*;
import ptolemy.kernel.util.*;

// Testa a extracao de method call de expressoes
public class MethodExtract extends AtomicActor {

   public MethodExtract(CompositeEntity container, String name) throws
           NameDuplicationException, IllegalActionException {
       super(container, name);       
   }
   
   public void fire() throws IllegalActionException {   
       int d = 3;
       System.out.println(metodo2() + metodo3());
       
       if(metodo2() == 12) {
           System.out.println("oi");
       }
       else
       if(metodo2() > 23) {
           System.out.println("oi2");
       }
       
       switch(metodo2()) {
           case 1:
	   
	   case 2: System.out.println("oi2"); break;
	   	   
	   case 3: System.out.println("oi3"); 
	   
	   case 4: System.out.println("oi4"); break;
       }
       
       int kx = 3;
       int pt = kx + metodo2();
       int xa = kx + 2*pt;
       
       while(xa > metodo2()) {
           System.out.println("123");
	   xa--;
       }
       
       for(int i = 0;i < metodo2();i++) {
           System.out.println(kx);
       }
       
       for(int i = metodo2();i < 10;i++) {
           System.out.println("merda");
       }

       
       for(int i = 0;i < 10;i += metodo2()) {
           System.out.println("merda");
	   
	   if(i == 32) {
	       continue;
	   }
       }
       
   
   }
   
   public int metodo2() {
       return 2;
   }
   
   public double metodo3() {
      return 1.54;
   }


}
